/*
*  Copyright 2019-2025 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package com.hua.api.modules.order.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
* @website https://eladmin.vip
* @description /
* @author g
* @date 2025-07-22
**/
@Entity
@Data
@Table(name="goods_info")
public class GoodsInfo implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    @ApiModelProperty(value = "id")
    private Integer id;

    @Column(name = "`img_path`")
    @ApiModelProperty(value = "商品封面图片")
    private String imgPath;

    @Column(name = "`img_banner`")
    @ApiModelProperty(value = "轮播图图片")
    private String imgBanner;

    @Column(name = "`video_path`")
    @ApiModelProperty(value = "视频地址")
    private String videoPath;

    @Column(name = "`created_time`")
    @ApiModelProperty(value = "创建时间")
    private Date createdTime;

    @Column(name = "`goods_name`")
    @ApiModelProperty(value = "商品名称")
    private String goodsName;

    @Column(name = "`goods_text`")
    @ApiModelProperty(value = "备注（主花材）")
    private String goodsText;

    @Column(name = "`goods_desc`")
    @ApiModelProperty(value = "商品简介(花材)")
    private String goodsDesc;

    @Column(name = "`category_id`")
    @ApiModelProperty(value = "商品分类")
    private Integer categoryId;

    @Column(name = "`category_ids`")
    @ApiModelProperty(value = "分类组")
    private String categoryIds;

    @Column(name = "`goods_price`")
    @ApiModelProperty(value = "商品单价")
    private Double goodsPrice;

    @Column(name = "`unit`")
    @ApiModelProperty(value = "单位")
    private String unit;

    @Column(name = "`seq`")
    @ApiModelProperty(value = "商品排序")
    private Integer seq;

    @Column(name = "`hot`")
    @ApiModelProperty(value = "商品热度")
    private Integer hot;

    @Column(name = "`sale_num`")
    @ApiModelProperty(value = "销量")
    private Integer saleNum;

    @Column(name = "`sale_price`")
    @ApiModelProperty(value = "参考价格")
    private Double salePrice;

    @Column(name = "`sale_point`")
    @ApiModelProperty(value = "卖点")
    private String salePoint;

    @Column(name = "`flower_words`")
    @ApiModelProperty(value = "花语")
    private String flowerWords;

    @Column(name = "`pinyin`")
    @ApiModelProperty(value = "拼音")
    private String pinyin;

    @Column(name = "`py`")
    @ApiModelProperty(value = "拼音")
    private String py;

    @Column(name = "`goods_content`")
    @ApiModelProperty(value = "商品描述")
    private String goodsContent;

    @Column(name = "`state`")
    @ApiModelProperty(value = "状态")
    private String state;

    @Column(name = "`standard`")
    @ApiModelProperty(value = "1: 鲜花 2:永生花 3：蛋糕")
    private Integer standard;

    public void copy(GoodsInfo source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
